///@author:create by BZY
///Date: 2024/10/27 18:24
///Description: 更新信息
class UpgradeModel {
  String? downloadUrl;
  int? isForce;
  String? packageName;
  String? upgradeContent;
  int? versionCode;
  String? versionName;

  bool get force{
    return (isForce??0)==1;
  }

  UpgradeModel(
      {this.downloadUrl,
      this.isForce,
      this.packageName,
      this.upgradeContent,
      this.versionCode,
      this.versionName});

  factory UpgradeModel.fromJson(Map<String, dynamic> json) {
    return UpgradeModel(
      downloadUrl: json['downloadUrl'],
      isForce: json['isForce'],
      packageName: json['packageName'],
      upgradeContent: json['upgradeContent'],
      versionCode: json['versionCode'],
      versionName: json['versionName'],
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['downloadUrl'] = downloadUrl;
    data['packageName'] = packageName;
    data['upgradeContent'] = upgradeContent;
    data['versionCode'] = versionCode;
    data['versionName'] = versionName;
    data['isForce'] = isForce;
    return data;
  }
}
